from sqlmodel import SQLModel, Field

class RiskRule(SQLModel, table=True):
    id: int | None = Field(default=None, primary_key=True)
    max_drawdown: float = 0.10      # 10%
    single_pos_ratio: float = 0.20  # 单票 20%
    industry_ratio: float = 0.30    # 行业 30%
    enabled: bool = True
